home *** CD-ROM | disk | FTP | other *** search
- #include <exec/types.h>
- #include <exec/exec.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include "work:romconf/doorheader.h"
- #define gu getuserstring
- #define pm prompt
- #define hk hotkey
- #define sm sendmessage
- char cmd[200];
- void end();
- FILE *fi=NULL;
- void sr(char *str);
- main(int argc, char *argv[])
- {
-
- long Position;
-
-
- if(argc!=2)
- {
- printf("\n");
- printf("Zoom Edit v1.0, written by Joseph Hodge\n");
- printf("This is a door for AmiExpress v1.1w+\n");
- printf("\n");
- exit(0);
- }
- Register(argv[1][0]-'0');
- sm("ZOOM-EDIT v1.0, written by Joseph Hodge",1);
- sm("",1);
- fi=fopen("DOORS:ZOOME/ZOOM.Mail","r");
- if(fi==NULL)
- {
- sm("",1);
- sm("No mail to process!!",1);
- sm("",1);
- ShutDown();
- end();
- }
- Position=ftell(fi);
- while(fgets(cmd,80,fi)!=NULL)
- {
- sr(cmd);
- if(!strncmp(cmd,"=====",5))
- {
- sm("",1);
- sm("a)bort, r)eply, C)ontinue >:",0);
- hk("",cmd);
- if(cmd[0]<' ' || cmd[0]=='C' || cmd[0]=='c')
- { sm("Continue.",1); sm("",1); Position=ftell(fi);continue; }
- if(cmd[0]=='r' || cmd[0]=='R')
- {
- sm("Reply. (not implemented)",1);
- sm("",1);
- Position=ftell(fi);
- continue;
- }
- if(cmd[0]=='A' || cmd[0]=='a')
- {
- sm("Abort.",1); sm("",1); fclose(fi); ShutDown(); end();
- }
- }
- else
- sm(cmd,1);
- }
- fclose(fi);fi=NULL;
- ShutDown();
- end();
-
- }
-
- void end()
- {
- if(fi!=NULL) fclose(fi);
- exit(0);
- }
-
- void sr(char *str)
- {
- register int i;
- i=strlen(str)-1;
- while(i)
- {
- if(*(str+i)<=' ') *(str+i)='\0'; else break;
- i--;
- }
- }